\documentclass[]{beamer}


%\documentclass[handout]{beamer}
\usepackage{pgf,pgfpages}
%\pgfpagesuselayout{2 on 1}[a4paper, portrait, border shrink=0.5in]

\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{ulem}
\usepackage{units}
\usepackage{epigraph}		% nice format for quotes
\usepackage{verbatim}		% write verbatim text
\usepackage{listings}		% include source code
\usepackage{hyperref}		% include url links

% add graphics path
\graphicspath{{figs/}}
%-----------------------


\mode<presentation>
{
  \usetheme{ift}
  \setbeamercovered{transparent}
  \setbeamertemplate{items}[square]
}

\usefonttheme[onlymath]{serif}
\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
\setbeamerfont{title}{size=\LARGE,series=\bfseries}

\beamertemplatenavigationsymbolsempty

\defbeamertemplate{enumerate item}{mycircle}
{
  \begin{pgfpicture}{0ex}{0ex}{1.5ex}{0ex}
    \pgfbox[center,base]{\color{uibg}\insertenumlabel.}
  \end{pgfpicture}%
}
[action]
{\setbeamerfont{item projected}{size=\scriptsize}}
\setbeamertemplate{enumerate item}[mycircle]
%
% Set title, author, date and affiliation (for the title page)
%
\title{\color{black}This is the title of the presentation}
\author{Lene S{\ae}len}
\date{\color{black}September 6, 2011}
\institute{Department of Physics and Technology, UiB }
%
% Begin the document
%
\begin{document}
%
% Define a new command for setting the background (uib template)
%
\newcommand{\setuibbackground}{
\setbeamertemplate{background}
{\includegraphics[width=1.0005\paperwidth,height=\paperheight]{slide_bg}}}
%
%
%***********************************************************************
% This is the title page (normally the first page!)
%***********************************************************************
% Set the background for the title page
\setbeamertemplate{background}
 {\includegraphics[width=1.0005\paperwidth,height=\paperheight]{frontpage_bg}}
% no footer 
\setbeamertemplate{footline}[default]

\begin{frame}[label=title]
  \titlepage
  \vspace{2cm}
\end{frame}

%***********************************************************************
%
% Activate the regular uib background 
% Insert uib-footer showing the section and slide number
%
\setuibbackground
\setbeamertemplate{footline}[ifttheme]
%
%***********************************************************************

\section{Introduction}
%***********************************************************************
% LaTeX
%***********************************************************************
\begin{frame}
    \frametitle{\LaTeX}

	\begin{itemize}
        \item \LaTeX is a typesetting language
	  \item All serious documents should be typeset using \LaTeX
	\end{itemize}

    Example:
	
	\begin{quote}	    \texttt{The energy is \$E = \textbackslash hbar \textbackslash omega\$} \end{quote}
	produces:
	
	\begin{quote}	    The energy is $E = \hbar \omega $. \end{quote}

\end{frame}


%***********************************************************************
% 
%***********************************************************************
\begin{frame}
    \frametitle{Advantages}
	\begin{itemize}
        \item Robust
        \item Flexible
        \item Control
        \item Reusable
	\end{itemize}

\end{frame}

\section{Basics}
%***********************************************************************
% Real time example
%***********************************************************************
\begin{frame}
    \frametitle{Real time example}
	\begin{itemize}
        \item We will take a look at a real time example of how to set up a latex file
	\end{itemize}

\end{frame}

%
% SECTION: A short LaTeX tutorial (this will print on the footer and the TOC)
%

%***********************************************************************
% How to make a list
%***********************************************************************
\begin{frame}
\frametitle{How to make a list}

\begin{itemize}
  \item You can make simple lists using \texttt{enumerate} (shown below) or \texttt{itemize} (this list) 
    For lists without bullets or numbering, use \texttt{description}.
\end{itemize}

\begin{enumerate}
\item This is the first item
\item This is the second item
\item The list environments can be customized: set margins, horizontal separation, enumerator,\ldots 
\end{enumerate}

\end{frame}

%***********************************************************************
% How to write verbatim
%***********************************************************************
\begin{frame}[fragile] % you need the fragile option to use verbatim and listing in beamer
  \frametitle{Verbatim text}

  \begin{itemize}
    \item To write verbatim text you need to add the package \textit{verbatim} at the beginning of the document.

  	\begin{verbatim}

	everything between begin{verbatim} 
	and end{verbatim} will be displayed
	exactly as you write it in the text
	<$%\

  	\end{verbatim}

  \end{itemize}
\end{frame}


%***********************************************************************
% Inserting source code
%***********************************************************************
\begin{frame}[fragile] % you need the fragile option to use verbatim and listing in beamer
  \frametitle{Inserting source code}

  \begin{itemize}
\item For displaying source code, the package \textit{listings} is useful.
  Set code language: (Python, TeX, Java, C++, \ldots)

	\lstset{language=[LaTeX]TeX}

\begin{lstlisting} 

  \lstset{language=[LaTeX]TeX}

  Put your code between 
  begin{lstlisting} and 
  end{lstlisting}

  or input entire file

  \lstinputlisting{source.tex}

  \end{lstlisting} 

  \end{itemize}
\end{frame}

%***********************************************************************
% Inserting source code
%***********************************************************************
\begin{frame}
  \frametitle{How to write equations}
  \begin{itemize}
    \item Write equations as eqnarray without numbering:
	\begin{eqnarray*}
	\nu_t = \frac{a_1 k}{\max (a_1 \omega,S F_2)}
	\end{eqnarray*}
\item Or write $\nu_t = \frac{a_1 k}{\max (a_1 \omega,S F_2)}$ in line with text.

  \end{itemize}

\end{frame}

%***********************************************************************
%*...How to write in two columns...
%***********************************************************************
\begin{frame}
\frametitle{How to write in two columns}

\begin{minipage}{0.49\textwidth}
Column 1
\end{minipage}
\begin{minipage}{0.49\textwidth}
Column 2
\end{minipage}

\end{frame}


%***********************************************************************
%*...How to write a centered table...
%***********************************************************************
\begin{frame}
	\frametitle{How to write a centered table}

	\begin{center}
	\begin{tabular}{c|c|c|l}
	\hline
	Rank & Common name & Basic name & Access function \\
	\hline
	0      & Scalar       & scalar     &   ~  \\
	1      & Vector       & vector     &   x(), y(), z()  \\
	2      & Tensor       & tensor     &   xx(), xy(), xz(), ...  \\
	\hline
	\end{tabular}
	\end{center}

\end{frame}

%***********************************************************************
%*...How to include a figure...
%***********************************************************************
\begin{frame}
	\frametitle{How to include a figure}

	\begin{center}
	  \begin{figure}[ht]
		\includegraphics[scale=.2]{6m_cube}
		  \caption{Streamlines (scaled picture)}
		\end{figure}


	      \end{center}
		

\end{frame}

\section{Error handling}
%***********************************************************************
% Error handling
%***********************************************************************
\begin{frame}
  \frametitle{Error handling}
  \begin{itemize}
    \item When you are compiling code, you will encounter errors. 
  \end{itemize}

  \begin{enumerate}
    \item Latex will try to explain what is wrong and list the line where the error occurred (vim will take you straight to the error)
    \item Check for unclosed environments (missing \$, \} , \textbackslash end\{\})
    \item If LaTeX doesn't understand a command, check that you have included the relevant package(s) in the preamble
    \item If you cannot solve the problem, internet will help you.
  \end{enumerate}

\end{frame}

\section{Exercise}
%***********************************************************************
% Exercise
%***********************************************************************
\begin{frame}
  \frametitle{Exercise}
  \begin{itemize}
      \item Transfer the text from yesterday to LaTeX. Try google-ing the things you need. It is part of the training to learn how to figure stuff out. Take a loook at the *.tex files from \url{http://code.google.com/p/master-101/downloads/} for inspiration.
  \end{itemize}

  \begin{itemize}
      \item You can find a challenge in exercise-1.pdf (download from master-101)
  \end{itemize}

\end{frame}


\section{BibTeX}
%***********************************************************************
% BibTeX
%***********************************************************************
\begin{frame}
  \frametitle{BibTeX}
  \begin{itemize}
      \item 
  \end{itemize}

  \begin{itemize}
      \item
  \end{itemize}

\end{frame}



\end{document}
